OSX install matplotlib without anaconda

If you ever tried to install matplotlib without using anaconda, then you probably pulled out some hair. After destroying my python environment several times, I finally figured it out. This solution only works for Mac, so sorry Linux and Windows users.

I recommend using pipenv to manage python version, because downloading python from brew was a pain in the ass when you need more than one version of python. I needed to use python 3.6, because at the time tensorflow did not support python 3.7.

First update brew and install pyenv pipenv

Create project directory

Install desired python version.

Access installed version of python

Install dependencies

Create file example.py and add the following in it:

Run script

Voila.